<?php

include("classes/include.php");


//supprimer une ligne 
if(isset($_POST['suppoffre']) && isset($_POST['select'])){

	$numero=$_POST['select'];

	$offre = new Offre($numero);

	$offre->supprimer();
	
	//$requete = new RequeteSQL("DELETE FROM offre where off_num_offre='$numero' ");
	//$requete->executeQuery();
	header("Location: administrationOffre.php"); 
}

//Valider une offre de stage
if(isset($_POST['valideoffre']) && isset($_POST['select'])){

$numero=$_POST['select'];
$requete = new RequeteSQL("UPDATE offre SET off_statut='1' where off_num_offre='$numero' ");
$requete->executeQuery();




header("Location: administrationOffre.php" );
}



//retrograder une offre de stage
if(isset($_POST['retrooffre']) && isset($_POST['select'])){

$numero=$_POST['select'];


$requete = new RequeteSQL("UPDATE offre SET off_statut='0' where off_num_offre='$numero' ");
$requete->executeQuery();




header("Location: administrationOffre.php" );
}
	


header("Location: administrationOffre.php" );


if(isset($_POST['ajoutoffre']) ){


header("Location: depotsOffre.php" );
}




?>